<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License.  You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->

<!-- Modal -->
<div class="modal fade" id="loginModal" tabindex="-1" role="dialog" aria-labelledby="loginModal" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <form [formGroup]="loginForm" (ngSubmit)="login(loginForm.value)" >
        <div class="modal-content">
            <div class="modal-header">
                <h5  class="modal-title" id="loginModalLabel">{{'login.title'|translate}}</h5>
                <button type="button" #closebutton class="close" data-dismiss="modal" aria-label="Close" >
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label for="userid" id="userid-label" >{{'login.userid' | translate}}</label>
                    <input id="userid" aria-labelledby="userid-label" class="form-control" placeholder="userid" formControlName="userid" />
                </div>
                <div class="form-group">
                    <label for="password" id="password-label" >{{'login.password' | translate}}</label>
                    <input id="password" aria-labelledby="password-label" class="form-control" type="password" formControlName="password" />
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal" >{{'modal.close'|translate}}</button>
                <button type="button" class="btn btn-primary" type="submit" >{{'login.submit'|translate}}</button>
            </div>
        </div>
        </form>
        <div *ngFor="let msg of errorMessages" class="alert alert-danger" >
            {{msg}}
        </div>
    </div>
</div>


